home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 3: CDPD 3
/
Almathera Ten on Ten - Disc 3: CDPD3.iso
/
scope
/
051-075
/
scopedisk57
/
pdmake
/
readenv.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-03-19
|
374b
|
22 lines
/*
* readenv() - set macro values from the environment
*/
#include <stdio.h>
readenv()
{
extern long _base;
char *envp, *p, *strchr();
char buf[256];
envp = *((char **) (_base + 0x2c));
for (; strncmp(envp, "ARGV=", 5) != 0 ; envp += strlen(envp) + 1) {
strcpy(buf, envp);
if ((p = strchr(buf, '=')) == NULL)
return;
*p++ = '\0';
setmacro(buf, p);
}
}